package com.example.experiment_2java.config;

import com.example.experiment_2java.interceptor.JWTInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Description:配置拦截器
 * @Author：Jukomu
 * @Package：org.csu.mypetstore.config
 * @Project：MyPetStore-SSM
 * @name：InterceptorConfig
 * @Date：2024/4/1 1:45
 * @Filename：InterceptorConfig
 */
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

    /**
     * 添加拦截器配置
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 添加JWT拦截器
        registry.addInterceptor(new JWTInterceptor());
    }
}
